/**
 * \file hardware_conf.h
 * Header: Hardware configuration
 * 
 * Configuration for all hardware related settings.
 * 
 * AT91SAM7S-128 USB Mass Storage Device with SD Card by Michael Wolf\n
 * Copyright (C) 2008 Michael Wolf\n\n
 * 
 * This program is free software: you can redistribute it and/or modify\n
 * it under the terms of the GNU General Public License as published by\n
 * the Free Software Foundation, either version 3 of the License, or\n
 * any later version.\n\n
 * 
 * This program is distributed in the hope that it will be useful,\n
 * but WITHOUT ANY WARRANTY; without even the implied warranty of\n
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n
 * GNU General Public License for more details.\n\n
 * 
 * You should have received a copy of the GNU General Public License\n
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n
 * 
 */
#ifndef HARDWARE_CONF_H_
#define HARDWARE_CONF_H_

#include "AT91SAM7S128.h"

/**
 * \name Clock constants
 * 
*/
//@{
#define EXT_OC          18432000   //!< External oscillator MAINCK
#define MCK             47923200   //!< MCK (PLLRC div by 2)
//@}

/**
 * \def USART0_BAUDRATE
 * Baudrate for USART0 communication speed 
 * 
*/
#define USART0_BAUDRATE     115200

/**
 * \name I/O pins
 * 
*/
//@{
#define PIN_CHARGE_IN   AT91C_PIO_PA7       //!< CHG input from LT4054
#define PIN_CHARGE_OUT  AT91C_PIO_PA8       //!< CHG output to LT4054
#define PIN_CARD_DETECT AT91C_PIO_PA18      //!< SD-card detect, 1=card inserted
#define PIN_POWER_ON    AT91C_PIO_PA29      //!< Power_On Hold,0=enable
#define PIN_USB_PULLUP  AT91C_PIO_PA21      //!< USB pull-up enable, 0=enable
#define PIN_USB_DETECT  AT91C_PIO_PA20      //!< USB bus voltage detection
#define PIN_LCD_RESET   AT91C_PIO_PA15      //!< LCD Reset pin, 0=reset
#define PIN_BTN_PRESS   AT91C_PIO_PA24      //!< Press button  
#define PIN_BTN_UP1     AT91C_PIO_PA25      //!< Up button, inner  
#define PIN_BTN_UP2     AT91C_PIO_PA26      //!< Up button, outer  
#define PIN_BTN_DN1     AT91C_PIO_PA27      //!< Down button, inner  
#define PIN_BTN_DN2     AT91C_PIO_PA28      //!< Down button, outer  
#define PIN_VS_RESET    AT91C_PIO_PA16      //!< VS1033 Reset
#define PIN_VS_DREQ     AT91C_PIO_PA17      //!< VS1033 DREQ
//@}

/**
 * \name Fast pointers to the internal peripherals
 * 
*/
//@{
extern AT91PS_PIO   pPIO;       //!< PIO controller
extern AT91PS_SPI   pSPI;       //!< SPI controller
extern AT91PS_PMC   pPMC;       //!< Power Management controller
//@}

#endif /*HARDWARE_CONF_H_*/
